package day5.gui;

import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class TestJComboBox extends JFrame {
	public TestJComboBox(String title) {
		this.setTitle(title);
		this.setSize(400, 500);
		this.setLocationRelativeTo(null);
		this.setResizable(false);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		//下拉框
		//构造器赋值不生效  //String[] values = {"简单","普通","困难"};
		JComboBox<String> box = new JComboBox<String>(new String[] {"Easy","Simple","Diffcult"});
		/*box.addItem("简单");
		box.addItem("普通");
		box.addItem("困难");*/
		
		
		JPanel p = new JPanel();
		p.add(box);
		this.add(p);
		this.setVisible(true);
	}
	public static void main(String[] args) {
		new TestJComboBox("单选框");
	}

}
